{% extends "skia_telemetry_base.html" %}

{% block content %}

<center>
{% if info_msg %}<font color="red"><b>{{ info_msg }}</b></font><br/><br/>{% endif %}

<h2>Run Skia patches on the SKP repositories</h2>
<br/>

{{ pending_tasks_count }} tasks currently in the <a align="center" href='pending_tasks'>Queue</a>
<br/>
Documentation for Skia Tryserver is <a href='http://goto/skiatryclustertelemetry'>here</a>
<br/>
Can only view HTML output with a google.com account
<br/>
<br/>

{% if not is_google_chromium_user %}
  Must have a google or chromium account to trigger try runs (contact rmistry@)<br/><br/>
{% else %}
  <form name="SkiaTryForm" action="skia_try" method="post">
  <table cellingpadding="5">
    <tr>
      <td>SKP Repository</td>
      <td>
        <select name="pagesets_type_and_chromium_build">
          {% for pageset_type, chromium_builds in pagesets_to_builds.items %}
            {% for chromium_rev, skia_rev, chromium_rev_date in chromium_builds %}
              <option value="{{ pageset_type }}-{{ chromium_rev }}-{{ skia_rev }}">
               {{ pageset_type }} created with {{ chromium_rev|slice:":7" }}-{{ skia_rev|slice:":7" }} (Chromium rev created on {{ chromium_rev_date}})
              </option>
            {% endfor %}
          {% endfor %}
        </select>
      </td>
    </tr>
    <tr>
      <td>Render Pictures Args</td>
      <td>                                                                      
        <input type="text" name="render_pictures_args" size="80" value="--clone 1 --config 8888 --viewport 4000 4000 --mode simple"/>
      </td>
    </tr>
    <tr>
      <td>Nopatch run with GPU</td>
      <td>
        <select name="gpu_nopatch_run">
          <option selected="selected">False</option>
          <option>True</option>
        </select>
      </td>
    </tr>
    <tr>
      <td>Withpatch run with GPU</td>
      <td>
        <select name="gpu_withpatch_run">
          <option selected="selected">False</option>
          <option>True</option>
        </select>
      </td>
    </tr>
    <tr>
      <td>Description</td>
      <td>
        <input type="text" name="description" size="80"/>
      </td>                                                                     
    </tr>                                                                       
    <tr>
      <td>Git patch (optional)</td>
      <td>
        <textarea name="patch" cols="80" rows="20"></textarea>
      </td>
    </tr>
    <tr> 
      <td colspan="2" align="center"><input type="submit" value="Queue SkiaTry Task"></td>
    </tr>
  </table>

  <br/>
  <br/>

  </form>
{% endif %}
<hr/>

  <h2>Your Try runs history</h2>
  <br/>

  {% if skia_try_tasks %}
    {% include "skia_try_tasks_table.html" %}
  {% else %}
    No Previous runs yet.
  {% endif %}
  <br/>
  <a href='all_tasks#skia_try'>View runs of all users</a>
</center>

{% endblock %}
